from rest_framework import serializers
from .models import Category, Upload


class CategorySerializer(serializers.ModelSerializer):
    cc = serializers.SerializerMethodField()

    def get_cc(self, obj):
        dd = Category.objects.filter(pk=1000)
        print(dd.count())
        return ''

    class Meta:
        model = Category
        fields = '__all__'


class UploadSerializer(serializers.ModelSerializer):
    class Meta:
        model = Upload
        fields = '__all__'
